package com.njwb.sentinel.controller;

import com.njwb.sentinel.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private GoodsService goodsService;
    @PostMapping("/order/add")
    public String add()  {

        System.out.println("下了一个订单");
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        goodsService.query();
        return "订单成功";
    }

    @GetMapping("/order/get")
    public String get(){
        System.out.println("查询一个订单");
        goodsService.query();
        return "订单明细";
    }
}
